import { useState, useEffect } from 'react';
import { show } from '../../../api';
import { useParams } from 'react-router-dom';
import { Spin, Empty } from 'antd';

const Query = (props) => {
  const [hospital, setHospital] = useState({});
  const { hoscode } = useParams();

  useEffect(async () => {
    const { hospital } = await show(hoscode);
    setHospital(hospital);
  }, []);

  if (!hospital.hosname)
    return (
      <div className='m-l-30 m-r-30'>
        <Spin />
      </div>
    );

  return (
    <div className='m-l-30 m-r-30'>
      <center>
        <h2>{hospital.hosname}查询取消信息</h2>
        <Empty description='暂无信息' />
      </center>
    </div>
  );
};

export default Query;
